gtk_css_static_style_new_compute (GtkStyleProviderPrivate *provider,
const GtkCssMatcher *matcher,
int scale,
- GtkCssStyle *parent,
- GtkCssChange *out_change)
+ GtkCssStyle *parent)
{
GtkCssStaticStyle *result;
GtkCssLookup *lookup;
+ GtkCssChange change = GTK_CSS_CHANGE_ANY_SELF | GTK_CSS_CHANGE_ANY_SIBLING | GTK_CSS_CHANGE_ANY_PARENT;
lookup = _gtk_css_lookup_new (NULL);
_gtk_style_provider_private_lookup (provider,
matcher,
lookup,
- out_change);
+ &change);
result = g_object_new (GTK_TYPE_CSS_STATIC_STYLE, NULL);
+ result->change = change;
+
_gtk_css_lookup_resolve (lookup,
provider,
scale,
result = g_object_new (GTK_TYPE_CSS_STATIC_STYLE, NULL);
+ result->change = style->change;
result->depends_on_parent = _gtk_bitmask_subtract (_gtk_bitmask_union (result->depends_on_parent, style->depends_on_parent),
changes);
result->equals_parent = _gtk_bitmask_subtract (_gtk_bitmask_union (result->equals_parent, style->equals_parent),
_gtk_css_value_unref (specified);
}
+GtkCssChange
+gtk_css_static_style_get_change (GtkCssStaticStyle *style)
+{
+ g_return_val_if_fail (GTK_IS_CSS_STATIC_STYLE (style), GTK_CSS_CHANGE_ANY);
+
+ return style->change;
+}
GtkBitmask *equals_parent; /* values that equal their parent values */
GtkBitmask *depends_on_color; /* values that depend on the color property */
GtkBitmask *depends_on_font_size; /* values that depend on the font-size property */
+
+ GtkCssChange change; /* change as returned by value lookup */
};
struct _GtkCssStaticStyleClass
GtkCssStyle * gtk_css_static_style_new_compute (GtkStyleProviderPrivate *provider,
const GtkCssMatcher *matcher,
int scale,
- GtkCssStyle *parent,
- GtkCssChange *out_change);
+ GtkCssStyle *parent);
GtkCssStyle * gtk_css_static_style_new_update (GtkCssStaticStyle *style,
const GtkBitmask *parent_changes,
GtkStyleProviderPrivate *provider,
GtkCssValue *specified,
GtkCssSection *section);
+GtkCssChange gtk_css_static_style_get_change (GtkCssStaticStyle *style);
+
G_END_DECLS
#endif /* __GTK_CSS_STATIC_STYLE_PRIVATE_H__ */
guint frame_clock_update_id;
GdkFrameClock *frame_clock;
- GtkCssChange relevant_changes;
GtkCssChange pending_changes;
const GtkBitmask *invalidating_context;
g_object_unref);
priv->screen = gdk_screen_get_default ();
- priv->relevant_changes = GTK_CSS_CHANGE_ANY;
/* Create default info store */
priv->info = style_info_new ();
static GtkCssStyle *
build_properties (GtkStyleContext *context,
- const GtkCssNodeDeclaration *decl,
- GtkCssChange *out_change)
+ const GtkCssNodeDeclaration *decl)
{
GtkStyleContextPrivate *priv;
GtkCssMatcher matcher;
style = gtk_css_static_style_new_compute (GTK_STYLE_PROVIDER_PRIVATE (priv->cascade),
&matcher,
priv->scale,
- parent,
- out_change);
+ parent);
else
style = gtk_css_static_style_new_compute (GTK_STYLE_PROVIDER_PRIVATE (priv->cascade),
NULL,
priv->scale,
- parent,
- out_change);
+ parent);
gtk_widget_path_free (path);
return values;
}
- values = build_properties (context, info->decl, NULL);
+ values = build_properties (context, info->decl);
g_hash_table_insert (priv->style_values,
gtk_css_node_declaration_ref (info->decl),
g_object_ref (values));
}
else
{
- values = build_properties (context, info->decl, &priv->relevant_changes);
- /* These flags are always relevant */
- priv->relevant_changes |= GTK_CSS_CHANGE_SOURCE;
+ values = build_properties (context, info->decl);
}
style_info_set_values (info, values);
decl = gtk_css_node_declaration_ref (context->priv->info->decl);
gtk_css_node_declaration_set_state (&decl, state);
- values = build_properties (context, decl, NULL);
+ values = build_properties (context, decl);
gtk_css_node_declaration_unref (decl);
return values;
}
static gboolean
-gtk_style_context_needs_full_revalidate (GtkStyleContext *context,
- GtkCssChange change)
+gtk_style_context_style_needs_full_revalidate (GtkCssStyle *style,
+ GtkCssChange change)
{
- GtkStyleContextPrivate *priv = context->priv;
-
/* Try to avoid invalidating if we can */
if (change & GTK_STYLE_CONTEXT_RADICAL_CHANGE)
return TRUE;
- if (priv->relevant_changes & change)
+ if (GTK_IS_CSS_ANIMATED_STYLE (style))
+ style = GTK_CSS_ANIMATED_STYLE (style)->style;
+
+ if (gtk_css_static_style_get_change (GTK_CSS_STATIC_STYLE (style)) & change)
return TRUE;
else
return FALSE;
/* Try to avoid invalidating if we can */
if (current == NULL ||
- gtk_style_context_needs_full_revalidate (context, change))
+ gtk_style_context_style_needs_full_revalidate (current, change))
{
GtkCssStyle *values;
- if ((priv->relevant_changes & change) & ~GTK_STYLE_CONTEXT_CACHED_CHANGE)
- {
- gtk_style_context_clear_cache (context);
- }
- else
- {
- gtk_style_context_update_cache (context, parent_changes);
- }
+ gtk_style_context_clear_cache (context);
style_info_set_values (info, NULL);
values = style_values_lookup (context);